<?php
/*
 * Template Name: register account complete
 *
 */
/**
 *
 * @abstract Register account complete page
 * @author HoanVX
 * @version : $Id: register-complete.php 75 2015-01-25 02:54:10Z voxuanhoan@gmail.com $
 */

get_header ();
?>
<!-- header-section-ends -->
<!-- content-section-starts -->
<div class="content">
	<div class="container register">
		<div class="col-md-12 ">
			<h2 class="text-success">Đăng ký tài khoản thành công</h2>
      		<?php
				TagUtils::hidden ( 'createUserStatus', 1 );

				global $isUserLogin;

				// neu dang nhập tự động bị lỗi
				if (is_wp_error ( $isUserLogin )) {
					$mesage = Messages::MESSAGE_REGISTER_SUCCESS_REDIRECT_TO_LOGIN;
					TagUtils::hidden ( "redirectUrl", get_the_permalink ( "33" ) ); // Id của trang dang nhap la 33
				} else {
					$mesage = Messages::MESSAGE_REGISTER_SUCCESS_REDIRECT_TO_PROFILE;
					TagUtils::hidden ( "redirectUrl", get_the_permalink ( "2" ) );
				}

				// Release global $isUserLogin
				unset($isUserLogin);
			?>
      		<div class="panel panel-info">
				<div class="panel-heading">
					<p>Chúc mừng bạn đã đăng ký tài khoản thành công</p>
					<p><?php echo $mesage; ?></p>
					<p><a href="<?php echo get_the_permalink(30);?>">Về trang đăng tin</a></p>
				</div>
			</div>
		</div>
	</div>
    <?php
	// TODO: HOANVX WILL ADDED THIS SECTION LATER
	// include_once ("commons/ads-section.php");
	?>

	<!-- Contact's information -->
	<?php get_footer("contact");?>
	<!-- END Contact's information -->
</div>
<!-- content-section-ends -->
<!-- footer-section-starts -->
<?php get_footer();?>
<script type="text/javascript">
jQuery(document).ready(function($) {
    // Rediect page
    if( $("input[name='createUserStatus']").val() == "1") {
		setTimeout(function() {
		    location.href = $("input[name='redirectUrl']").val();
		}, 5000);
    }
});
</script>
